package v1ch7.SizedFrameTest;

import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.JFrame;

public class SizedFrameTest {
	public static void main(String[] args) {
		SizedFrame frame = new SizedFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}

@SuppressWarnings("serial")
class SizedFrame extends JFrame {

	public SizedFrame() {
		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension screenSize = kit.getScreenSize();
		int screenHeight = screenSize.height;
		int screenWidth = screenSize.width;

		setSize(screenWidth / 2, screenHeight / 2);
		setLocationByPlatform(true);

		Image img = kit.getImage("RAD_v7.GIF");
		setIconImage(img);
		setTitle("SizeFrame");
	}

}